home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*_________________________________________________________________________
- |
- | blixvect.h - functions to support operations on vectors and matrices.
- |
- | Lots of original code from David Ciemiewicz, Mark Grossman, Henry Moreton,
- | Paul Haeberli, and Gavin Bell.
- |
- | Frans van Hoesel added more specific prototypes, inline pragma's,
- | and some functions (not all of them are tested)
- |
- */
-
- #ifndef VECT_H_SEEN
- #define VECT_H_SEEN
-
- #include <math.h>
- #include <gl/gl.h>
-
-
- /* definitions of coordinate indices */
- #define X 0
- #define Y 1
- #define Z 2
- #define W 3
- #define THETA 0
- #define PHI 1
- #define R 2
-
- void frompolar(const float p[2], float v[3]);
- void frompolar3(const float p[3], float v[3]);
- void topolar(const float v[3], float p[2]);
- void topolar3(const float v[3], float p[3]);
- float vdistance(const float v1[3], const float v2[3]);
- float vdistance2(const float v1[3], const float v2[3]);
- float vdistance_angle(const float p1[2], const float p2[2]);
- float *vnew(void);
- float *vclone(const float [3]);
- void vcopy(const float [3] , float [3]);
- void vprint(const float [3]);
- void vset(float [3], const float, const float, const float);
- void vzero(float [3]);
- void vnormal(float [3]);
- void vnormal2(const float v[3], float dst[3]) ;
- float vlength(const float [3]);
- void vscalar(float [3], const float);
- void vmult(const float [3], const float [3], float [3]);
- void vadd(const float [3], const float [3], float [3]);
- void vsub(const float [3], const float [3], float [3]);
- void vhalf(const float [3], const float [3], float [3]);
- float vdot(const float [3], const float [3]);
- int veq(const float [3], const float [3]);
- void vcross(const float [3], const float [3], float [3]);
- void vdirection(const float v1[3], const float v2[3], float dir[3]);
- void vreflect(const float [3], const float [3], float [3]);
- void vtransform(const float [3], const Matrix, float [3]);
- void vtransform4(const float [4], const Matrix, float [4]);
- void vrot_axis(const float v1[3], const float a[3], const float alpha,
- float v2[3]);
-
-
- extern Matrix idmatrix;
- extern float x_axis[];
- extern float y_axis[];
- extern float z_axis[];
-
- void mcopy(const Matrix, Matrix);
- void minvert(const Matrix, Matrix);
- void mprint(const Matrix);
- void mmultmatrix(const Matrix, const Matrix, Matrix);
- void mgetmatrix(Matrix);
- void mmakerot(const float *, const float *, Matrix);
- void mbuild_polar_rot(const float [2], Matrix);
- void mmake_rot_axis(const float [3], const float, Matrix);
-
- void linsolve(const float *[], int, float *);
-
- #endif /* VECT_H_SEEN */
-
-